package com.css.dzj.dzjportal.common.util;

import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

public class StaticAPI {
    private static RestTemplate restTemplate;
    private static ClientHttpRequestFactory clientHttpRequestFactory;

    static {
        if (restTemplate == null) {
            restTemplate = PlatformSpringUtils.getBean(RestTemplate.class);
        }
        if (clientHttpRequestFactory == null) {
            clientHttpRequestFactory = PlatformSpringUtils.getBean(ClientHttpRequestFactory.class);
        }

    }

    public static RestTemplate getRestTemplate() {
        return restTemplate;
    }

    public static ClientHttpRequestFactory getClientHttpRequestFactory() {
        return clientHttpRequestFactory;
    }
}
